<template>
  <div class="app-container">
    <!-- 头部 -->
    <div class="ProductionDynamicHeader">
      <Find :OriginalFilter="{ static: true }" :formList="formList" @findClicked="findData" />
    </div>

    <!-- 主体 -->
    <el-card class="ProductionDynamicMainCard" shadow="always" :body-style="{ padding: '5' }">
      <!-- card body -->
      <!-- 表格 -->
      <div class="ProductionDynamicMainCardMain">
        <div class="ProductionDynamicMainCardMainLeft">
          <h1 class="MainLeftCardH1">用量明细资料</h1>
          <Table :tableData="tableData" :tableHeader="tableHeader" :selection="false" :TableHeight="'159rem'" />
          <div style="display: flex">
            <!-- 输入框 -->
            <el-form-item label="大底名称和颜色" style="font-size: 9px; height: 15px">
              <el-input style="width: 303px; height: 25px; margin-top: 5px" />
            </el-form-item>

            <el-form-item class="elForm" label="订单备注信息" style="font-size: 9px; height: 15px; margin-left: 30px">
              <el-input style="width: 303px; height: 25px; margin-top: 5px" />
            </el-form-item>
          </div>
          <div style="margin-top: 20rem">
            <h1 class="MainLeftCardH1">贴合子材料明细</h1>
            <Table :tableData="tableData1" :tableHeader="tableHeader1" :selection="false" :TableHeight="'35rem'" />
          </div>
        </div>
      </div>
      <!-- 分页器 -->
      <div class="bottom">
        <span class="total">共666项数据</span>
        <el-pagination
          v-model:current-page="currentPage"
          v-model:page-size="pageSize"
          :page-sizes="[10, 20, 30, 40]"
          layout="sizes, prev, pager, next, jumper"
          :total="total"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
        />
        <div>
          <el-button class="save" type="primary" size="default" @click="">保存</el-button>
          <el-button type="primary" size="default" @click="">打印</el-button>
        </div>
      </div>
    </el-card>
  </div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
import JMessage from '@/utils/JMessage'
export default defineComponent({
  name: 'TypeBomQuery'
})
</script>
<script lang="ts" setup>
import { i18n, Jzhcn } from '@/i18n'
import Find from '@/components/Find/index.vue'
const formList = ref([
  {
    type: 'input',
    inputPlaceholder: '请输入型体',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入颜色',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入部位',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入开发物料编码',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入业务物料编码',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入材料名称',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入规格',
    inputValue: ''
  },

  {
    type: 'button',
    checkboxLabel: '置空',
    bgColor: '#1890FF'
  },
  {
    type: 'button',
    checkboxLabel: '导出'
  }
])

const findData = (data: any) => {
  console.log(data)
}

// 表格数据
const tableData = [
  {
    date: '20230427',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312',
    customer: 'jzy',
    checkboxArrange: true
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  }
]

const tableHeader = ref([
  {
    label: '型体',
    prop: 'customer'
  },
  {
    label: '颜色',
    prop: 'instruction'
  },
  {
    label: '序号',
    prop: 'shape'
  },
  {
    label: '部位',
    prop: 'shape'
  },
  {
    label: '分段',
    prop: 'shape'
  },
  {
    label: '分类名称',
    prop: 'shape'
  },
  {
    label: '物料编码',
    prop: 'shape'
  },
  {
    label: '材料颜色',
    prop: 'shape'
  },
  {
    label: '材料名称',
    prop: 'shape'
  },
  {
    label: '规格',
    prop: 'shape'
  },
  {
    label: '单位',
    prop: 'shape'
  },
  {
    label: '尺码起',
    prop: 'shape'
  },
  {
    label: '尺码止',
    prop: 'shape'
  },
  {
    label: '厂商',
    prop: 'shape'
  },
  {
    label: '用量',
    prop: 'shape'
  },
  {
    label: '计算方式',
    prop: 'name',
    type: 'select'
  }
])

// 表格数据
const tableData1 = [
  {
    date: '20230427',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312',
    customer: 'jzy',
    checkboxArrange: true
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: '12312'
  }
]

const tableHeader1 = ref([
  {
    label: '物料编码',
    prop: 'customer'
  },
  {
    label: '材料颜色',
    prop: 'instruction'
  },
  {
    label: '材料名称',
    prop: 'shape'
  },
  {
    label: '规格',
    prop: 'shape'
  },
  {
    label: '单位',
    prop: 'shape'
  },
  {
    label: '加工方式',
    prop: 'shape'
  },
  {
    label: '供应商',
    prop: 'shape'
  },
  {
    label: '比例',
    prop: 'shape'
  },
  {
    label: '是否请购',
    type: 'checkbox',
    prop: 'checkboxArrange'
  }
])

// 分页器
const currentPage = ref(1)
const pageSize = ref(10)
const total = ref(658)
const handleSizeChange = (val: number) => {
  console.log(`${val} items per page`)
}
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`)
}
</script>

<style lang="less" scoped>
// 主体样式
.ProductionDynamicMain {
  margin-top: 20px;
}

.MainLeftCardH1 {
  font-size: 16px;
  margin: 10px 0 10px 0;
}

.ProductionDynamicMainCardBottomBtn {
  margin-top: 30px;
}

.ProductionDynamicMainCardMainLeft {
  width: 100%;
}

.bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;

  .total {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    font-family: PingFangSC-Regular-, PingFangSC-Regular;
  }

  :deep(.el-input__wrapper) {
    padding: 0;
  }

  :deep(.el-input__suffix) {
    transform: translateX(-9px);
  }

  :deep(.el-pagination .el-select .el-input) {
    width: 88px;
  }

  :deep(.number) {
    border: 1px solid #dcdcdc;
    margin-right: 8px;
    border-radius: 3px 3px 3px 3px;
  }

  :deep(.is-active.number) {
    background-color: #f89027 !important;
    color: white;
    border-radius: 3px 3px 3px 3px;
  }

  .save {
    color: black;
    border: 1px solid #e7e7e7;
    background: #e7e7e7;
  }
}

.ProductionDynamicMainCard {
  margin-top: 10rem;
}
</style>
